package sketch.generator;

import sketch.SMethod;
import sketch.SketchSequence;
import sketch.ValueChoice;
import sketch.subject.TreeMap;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class RandomSequenceGeneratorTest extends TestCase {
	
	public static Test suite() {
        return new TestSuite(RandomSequenceGeneratorTest.class);
    }
	
	public void testRandomGenerator() {
		System.out.println("executing testRandomGenerator");
		GenTests.reset(TreeMap.class);
		TreeMap tree = new TreeMap();
		SMethod smethod = SMethod.instance(tree, "put(int)", "remove(int)", "containsKey(int)");
		ValueGenerator<Integer> valueGen = ValueChoice.getIntPool(5, 1, 20); 
		
		SequenceGenerator<SketchSequence> seqGen = new RandomSequenceGenerator<SketchSequence>(tree, smethod, valueGen);
		int count = 0;
		while(seqGen.hasNext() && (count++) < 9) {
			Object s = seqGen.next();
			//System.out.println("generating: " + s);
			System.out.println(seqGen.getGeneratedSequence());
			seqGen.reset();
		}
		System.out.println();
	}

}
